<?php
/**
 * Created by PhpStorm.
 * User: Dell
 * Date: 2019-3-7
 * Time: 11:24
 */

namespace app\common\validate;


use think\Validate;

class MemberValidate extends Validate
{
    protected $rule = [
        ['memb_name', 'require', '昵称不能为空'],
        ['memb_password', 'require', '密码不能为空'],
        ['memb_phone', 'require|max:11|/^1[3-8]{1}[0-9]{9}$/', '手机号不能为空|手机号码最多不能超过11个字符|手机号码格式不正确'],
        ['memb_sex', 'require|between:0,2', '性别不能为空|无效性别选项'],
        ['memb_city', 'require', '省市县不能为空'],
        ['memb_address', 'require', '详细地址不能为空'],
        ['memb_addrName', 'require', '收件人不能为空'],
        ['memb_addrPhone', 'require|max:11|/^1[3-8]{1}[0-9]{9}$/', '手机号不能为空|手机号码最多不能超过11个字符|手机号码格式不正确'],
    ];

    protected $scene = [
        'edit'  =>  ['memb_name','memb_sex'],
        'add'  =>  ['memb_phone','memb_password'],
        'address'  =>  ['memb_addrPhone','memb_addrName','memb_city','memb_address'],
        'pwd'  =>  ['memb_password'],
        'openid'  =>  ['memb_id','memb_openid'],
    ];
}